import request from '@/utils/request'

// 查询BOM详情tree下拉列表
export function treeselect(query) {
  return request({
    url: '/base/info/treeselect',
    method: 'get',
    params: query
  })
}

// 查询物料BOM
export function getBomDetail(id) {
  return request({
    url: '/base/info/' + id,
    method: 'get'
  })
}

// 新增物料BOM
export function addBomDetail(data) {
  return request({
    url: '/base/info',
    method: 'post',
    data: data
  })
}

// 修改物料BOM
export function updateBomDetail(data) {
  return request({
    url: '/base/info',
    method: 'put',
    data: data
  })
}

// 删除物料清单
export function delBomDetail(bomId) {
  return request({
    url: '/base/info/' + bomId,
    method: 'delete'
  })
}

// 导出物料清单
export function exportBomDetail(query) {
  return request({
    url: '/base/info/export',
    method: 'get',
    params: query
  })
}
